Bus packet format displaying method for logic analyzer

ABSTRACT

A bus packet format displaying method for a logic analyzer is disclosed. The logic analyzer fetches at least one packet of a bus of an electronic device. A computer host divides a plurality of bits of a second packet section of the packet into a plurality of message partitions according to a predetermined format defined in advance. Each of the message partitions has a value. The computer host gives a message name to each of the message partitions corresponding to the values and displays the message names and the values fetched by the logic analyzer on an operating screen.

BACKGROUND OF THE INVENTION Technical Field

The present invention is related to a packet data analysis method, andmore particularly to a bus packet format displaying method for a logicanalyzer.

Description of Related Art

It is known that in addition to the well-defined standardspecifications, there are still bus data that are not in the standardformat specifications. However, bus data that are not in the standardspecifications of the bus are often the focus of attention. Therefore, aconventional logic analyzer displays the bus data not in the standardspecifications of the bus on an operation screen, so that the user canobserve the variables of such bus data.

However, since these variables are not in the bus standardspecifications, the conventional logic analyzer will not know themeaning of the variables, and therefore the meaning of each of thevariables will not be correspondingly displayed on the operation screen.As a result, users cannot easily observe and analyze these variablesduring development and debugging. In all aspects, the conventional logicanalyzer still has room for improvements.

BRIEF SUMMARY OF THE INVENTION

In view of the above, the purpose of the present invention is to providea bus packet format displaying method for a logic analyzer, so that atleast one packet of a bus could be converted from an unformatteddisplaying mode to a formatted displaying mode.

The present invention provides a bus packet format displaying method fora logic analyzer, wherein the logic analyzer is adapted to fetch atleast one packet of a bus of an electronic device to store a file. Theat least one packet in the file includes a plurality of first packetsections, which meet a specification format of a bus standard, and asecond packet section, which does not meet the specification format ofthe bus standard. The first packet sections and the second packetsection include a plurality of bits. The bus packet format displayingmethod comprising steps of A. define a predetermined format whichcorresponds to a dividing manner of the bits of the second packetsection; B. fetch the at least one packet stored in the file; C. dividethe bits of the second packet section of the at least one packet into aplurality of message partitions based on the predetermined formatdefined in step A, wherein each of the message partitions has acorresponding value; give each of the message partitions a message name;and D. display the message names and the values corresponding to themessage partitions on an operating screen.

The advantage of the present invention is that the user could directlyperceive the meaning and the value about the second packet section whichdoes not meet the specification format of the bus standard, whichfacilitates the user to determine the correctness of the packets,enhancing an efficiency of development and debugging.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

The present invention will be best understood by referring to thefollowing detailed description of some illustrative embodiments inconjunction with the accompanying drawings, in which

FIG. 1 is a perspective view, showing the structures of the logicanalyzer of the present invention;

FIG. 2 is a flowchart of fetching the packet of the present invention;

FIG. 3a is a schematic diagram, showing the packet format of the presentinvention;

FIG. 3b is a schematic diagram, showing the analyzed packet and thedisplaying format;

FIG. 4 is a data format table according to a first embodiment of thepresent invention;

FIG. 5 is a string table according to the first embodiment of thepresent invention;

FIG. 6 is a major index description table according to the firstembodiment of the present invention;

FIG. 7 is a data format table according to a second embodiment of thepresent invention;

FIG. 8 is a major index description table according to the secondembodiment of the present invention;

FIG. 9 is a data format table according to a third embodiment of thepresent invention;

FIG. 10 is a major index description table according to the thirdembodiment of the present invention; and

FIG. 11 is a string table according to the third embodiment of thepresent invention.

DETAILED DESCRIPTION OF THE INVENTION

FIG. 1 shows a structure of a logic analyzer 100 according to a firstembodiment of the present invention and is adapted to illustrate aflowchart of a packet displaying method shown in FIG. 2.

The logic analyzer 100 is electrically connected to an electronic device200 to fetch a plurality of packets 500 of a bus of the electronicdevice 200 and is further electrically connected to a computer host 300to merge the plurality of packets into a file and to store the file inthe computer host 300. The computer host 300 executes a decoding programto retrieve the file and analyzes the plurality of packets according toa predetermined format defined in advance, and then an analysis resultwould be displayed on an operating screen through a display 400. Inorder to illustrate easily, one of the packets 500 shown in FIG. 3a isused for illustration. In the current embodiment, the predeterminedformat includes a data format table 800, a major index description table700, and a string table 900 shown in FIG. 4 to FIG. 6.

In the current embodiment, the logic analyzer 100 receives and mergesthe plurality of packets 500 of the bus of the electronic device 200into the file, and stores the file in the computer host 300. In thecurrent embodiment, a specification of a bus standard of the bus is I2C,and the computer host 300 analyzes the packet 500 stored in the fileaccording to the predetermined format.

FIG. 3a is a schematic diagram of a format of the packet 500. The packet500 includes a plurality of first packet sections 501, which meet aspecification format of the bus standard, and a second packet section502, which does not meet the specification format of the bus standard,wherein the first packet section 501 and the second packet section 502include a plurality of bits.

FIG. 3b is a schematic diagram, showing the packet 500 is analyzed. Thecomputer host 300 divides the bits of the second packet section 502 intoa plurality of message partitions 600 according to the predeterminedformat, wherein each of the message partitions 600 has a value 602. Eachof the message partitions 600 corresponding to one of the values 602 isgiven a message name 601. The message names 601 and the values 602corresponding to the message partitions 600 are displayed on theoperating screen of the display 400, wherein an analyzing method wouldbe described as follow.

Each of the message partitions 600 describes a characteristic thereof byusing a major index field 812 a and a plurality of data fields 820 shownin FIG. 4, and the data format table 800, the major index descriptiontable 700, and the string table 900 are stored in the computer host 300.The user could edit the three tables (i.e., the data format table 800,the major index description table 700, and the string table 900) byhimself/herself, and the user could read the three tables by connectingthe logic analyzer 100 and the computer host 300. However, this is notlimited to the example given above. In other embodiments, the threetables could be stored in the logic analyzer 100.

As shown in FIG. 4, the data format table 800 includes the major indexfield 812 a and a message name field 814 a, wherein the major indexfield 812 a is filled with a major index variable 812 of a major index722, and the message name field 814 a is filled with a message namestring 814, and the message name string 814 corresponds to the majorindex variable 812 and is used as a name of the major index variable812.

Additionally, the data format table 800 further includes the data fields820 for describing a characteristic of the major index variable 812.Each of the data fields 820 includes a length field 832 a, a name field834 a, a significant bit field 836 a (MSB or LSB), and a minor indexfield 838 a, which are adapted to be respectively filled with a sectionlength value 832, a data-type name 834, a significant bit variable 836,and a minor index variable 838 which determine and describe acharacteristic of each of the data fields 820.

Moreover, the computer host 300 divides the second packet section 502into the message partitions 600 based on the section length values 832,wherein a unit of the section length value 832 is a bit. The data-typename 834 is adapted to determine a name of the data field 820. Thesignificant bit variable 836 is adapted to determine an order of thedata field 820. When the major index variables 812 are the same, each ofthe minor index variables 838 assists the computer host 300 to determinethe major index variable 812 to be selected, wherein each of the messagename strings 814 corresponds to one of the minor index variables 838 forbeing used as the name of the corresponding major index variable 812.

The data format table 800 further includes a description field 840 a,wherein the description field 840 a is adapted to be filled with a datatype description 840 for describing a characteristic of the data-typename 834, thereby to make the characteristic of the data-type name 834more clearly and detailed.

As shown in FIG. 5, the string table 900 includes the name field 902 a,a value field 904 a, and a displaying name field 906 a, which areadapted to be respectively filled with the data-type name 902 fordescribing the characteristic of the data-type name 834, the value 904corresponding to the data-type name 902, and the data displaying name906 corresponding to the data-type name 902, thereby to build thecharacteristic of each of the data-type names 834. In addition, thestring table 900 further includes a description field 908 a, which isadapted to be filled with a displaying name description 908 fordescribing each of the data-type names 902, thereby to make thecharacteristic of each of the displaying name descriptions 908 moreclear and detailed.

As shown in FIG. 6, the major index description table 700 includes astandard format table 701 and a major index table 702. In addition, themajor index description table 700 includes a packet section name field712 a, a displaying name field 714 a corresponding to the packet sectionname field 712 a, and a length field 716 a corresponding to the packetsection name field 712 a, which are adapted to be respectively filledwith a packet section name 712, a packet section displaying name 714,and a bit length value 716 for describing a characteristic of the packetsection name field 712 a. The major index table 702 has a major indexfield 722 a, a start bit field 724 a, and an end bit field 726 a,wherein the major index field 722 a is adapted to be filled with atleast one of the packet section names 712 of the first packet sections501 as a name of the major index 722. The start bit field 724 a isadapted to be filled with a start bit value 724. The end bit field 726 ais adapted to be filled with an end bit value 726. The major index 722corresponds to at least one of the packet section names 712 of the firstpacket sections 501. At least one of the packet section names 712 of thefirst packet sections 501 corresponds to at least one of the bit lengthvalues 716. The start bit value 724 and the end bit value 726 form a bitfetching range to determine a start bit fetching position and an end bitfetching position of the bit length value 716. In the currentembodiment, the start bit value 724 is 0 bit, and the end bit value 726is also 0 bit, so that a variable range of the major index variable 812is 0 or 1.

In the first embodiment, the computer host 300 fetches a plurality offetching bits of the first packet sections 501 within the bit fetchingrange based on the bit fetching range and compares the major indexvariables 812 of the data format table 800 to find the major indexvariable 812 that matches the fetching bits, and analyzes the bits ofthe second packet section 502 according to a characteristic of the datafield 820 describing the characteristic of the major index variable 812.Then, the computer host 300 analyzes the value 602 based on the sectionlength value 832, the significant bit variable 836, and the data-typename 834 corresponding to the major index variable 812, and based on thedata displaying name 906 corresponding to the data-type name 902 and thevalues 904 in the string table 900, thereby to give the value 602 thecorresponding data displaying name 906 as the message name 601 of themessage partition 600 to be displayed on the operating screen.

In this way, the user could directly perceive a meaning and the value602 about the second packet section 502 which does not meet thespecification format of the bus standard via the operating screen of thedisplay 400, which facilitates the user to determine the correctness ofthe packets 500, enhancing a work efficiency.

There is a packet format displaying method of the logic analyzer 100according to a second embodiment, wherein in the second embodiment, aspecification of a bus standard of the bus is CAN-BUS.

The difference between the packet format displaying method of the firstembodiment and that of the second embodiment is that, as shown in FIG.7, since the data-type name 834 of each of the data fields 820corresponds to only one corresponding value 602, so that the data-typename 834 corresponds to only one of the data displaying names 906.Therefore, the data-type name 834 and the corresponding value 602 do notneed to be filled into the string table, just fill data format table 800and make the string table being blank.

In the second embodiment, as shown in FIG. 7, the data format table 800has the same two of the major index variables 812, and therefore, thetwo corresponding minor index variables 838 are used to assist thecomputer host 300 to determine the major index variable 812 to beselected, wherein the two message name strings 814 corresponds to thetwo minor index variables 838 for being used as the name of the twomajor index variables 812.

In the second embodiment, as shown in FIG. 8, a name of the major index722 is formed by linking the two packet section names 712 of the firstpacket sections 501 with the “+” sign and filling in the major indexfield 722 a.

As shown in FIG. 7 and FIG. 8, the computer host 300 fetches a pluralityof fetching bits of the first packet sections 501 within the bitfetching range based on the bit fetching range and compares the majorindex variables 812 of the data format table 800 to find the major indexvariable 812 that matches the fetching bits, and analyzes the bits ofthe second packet section 502 according to a characteristic of the datafield 820 describing the characteristic of the major index variable 812.Then, the computer host 300 analyzes the value 602 based on the sectionlength value 832, the significant bit variable 836, and the data-typename 834 corresponding to the major index variable 812, and there is noneed to compare the string table 900, thereby to give the value 602 thecorresponding data-type name 834 as the message name 601 of the messagepartition 600 to be displayed on the operating screen.

There is a packet format displaying method of the logic analyzer 100according to a third embodiment, wherein in the third embodiment, aspecification of a bus standard of the bus is also CAN-BUS. Thedifference between the packet format displaying method of the thirdembodiment and that of the second embodiment is that, in the thirdembodiment, the data-type name 834 of each of the data fields 820corresponds to the value 904 corresponding to the data-type name 902,and each of the values 904 corresponds to only one of the datadisplaying names 906, so that the data-type name 902, the values 904corresponding to the data-type name 902, and the data displaying name906 corresponding to each of the values 904 should be filled into thestring table. In this way, the computer host 300 fetches a plurality offetching bits of the first packet sections 501 within the bit fetchingrange based on the bit fetching range and compares the major indexvariables 812 of the data format table 800 to find the major indexvariable 812 that matches the fetching bits, and analyzes the bits ofthe second packet section 502 according to a characteristic of the datafield 820 describing the characteristic of the major index variable 812.Then, the computer host 300 analyzes the value 602 based on the sectionlength value 832, the significant bit variable 836, the minor indexvariable 838, and the data-type name 834 corresponding to the majorindex variable 812, and based on the data displaying name 906corresponding to the data-type name 902 and the values 904 in the stringtable 900, thereby to give the value 602 the corresponding datadisplaying name 906 as the message name 601 of the message partition600.

There is a packet format displaying method of the logic analyzer 100according to a fourth embodiment, wherein in the fourth embodiment, aspecification of a bus standard of the bus is SPI. The differencebetween the packet format displaying method of the fourth embodiment andthat of the first embodiment is that, the major index variables 812 ofthe major index 722 are determined according to a plurality of channelnames of the logic analyzer 100 that could be inputted by the user. Asshown in FIG. 9 to FIG. 11 different from FIG. 4 of the firstembodiment, the major index variables 812 in FIG. 4 are values, whilethe major index variables 812 in FIG. 9 are strings, wherein the stringscould be numbers, letters, or a combination of the two. Morespecifically, the strings in FIG. 9 are number strings, wherein a numberstring “0” stands for “Channel 0”, and a number string “1” stands for“Channel 1”. In practice, the major index variables 812 in FIG. 9 couldbe letter strings, for example, a letter string “MOSI” and a letterstring “MISO”. In this way, when the major index field 722 a is filledwith “Channel Name” as the major index 722, the computer host 300fetches a plurality of fetching bits of the first packet sections 501within the bit fetching range based on the major index 722 and comparesthe major index variables 812 of the data format table 800 to find themajor index variable 812 that matches the fetching bits of the firstpacket sections 501, and analyzes the bits of the second packet section502 according to a characteristic of the data field 820 describing thecharacteristic of the major index variable 812. Then, the computer host300 analyzes the value 602 based on the section length value 832, thesignificant bit variable 836, and the data-type name 834 correspondingto the major index variable 812, and based on the data displaying name906 corresponding to the data-type name 902 and the values 904 in thestring table 900, thereby to give the value 602 the corresponding datadisplaying name 906 as the message name 601 of the message partition 600to be displayed on the operating screen.

With the aforementioned design, the logic analyzer 100 could fetch thepackets 500 of the bus of the electronic device 200. The computer host300 divides the second packet section 502 into the values 602 of themessage partitions 600 based on the section length value 832 accordingto a setting of the data format table 800, the major index descriptiontable 700, and the string table 900 of the predetermined format, therebyto give the value 602 the corresponding data-type name 834 or thecorresponding data displaying name 906 as the message name 601 of themessage partition 600, so that the at least one packet 500 of the buscould be converted from an unformatted displaying mode to a formatteddisplaying mode. In this way, the user could directly perceive themeaning and the value 602 about the second packet section 502 which doesnot meet the specification format of the bus standard, facilitating theuser to determine the correctness of the packets 500 and enhancing awork efficiency. In practice, the logic analyzer 100 could fetch the atleast one packet 500 of the bus of the electronic device 200, and storeit into the file, so that the computer host 300 could execute theaforementioned packet format displaying method.

It must be pointed out that the embodiments described above are onlysome embodiments of the present invention. All equivalent methods whichemploy the concepts disclosed in this specification and the appendedclaims should fall within the scope of the present invention.

What is claimed is:
 1. A bus packet format displaying method for a logicanalyzer, wherein the logic analyzer is adapted to fetch at least onepacket of a bus of an electronic device to store a file; the at leastone packet in the file includes a plurality of first packet sections,which meet a specification format of a bus standard, and a second packetsection, which does not meet the specification format of the busstandard; the first packet sections and the second packet sectioninclude a plurality of bits; the bus packet format displaying methodcomprising steps of: A. defining a predetermined format whichcorresponds to a dividing manner of the bits of the second packetsection, wherein the predetermined format comprises a section lengthvalue corresponds to each of the message partitions; a major index fieldand a plurality of data fields are used to describe a characteristic ofeach of the message partitions; the predetermined format furthercomprises a data format table; the data format table comprises the majorindex field; a major index variable of a major index is filled into themajor index field; the data format table further comprises the datafields for describing the characteristic of each of the messagepartitions; each of the data fields comprises a length field which isadapted to be filled with one of the section length values fordetermining a data length of each of the data fields and a name fieldwhich is adapted to be filled with a data-type name for determining adata type of each of the data fields; B. fetching the at least onepacket stored in the file; C. dividing the bits of the second packetsection of the at least one packet into a plurality of messagepartitions based on each of the section length values of thepredetermined format defined in step A, wherein each of the messagepartitions has a corresponding value; giving each of the messagepartitions a message name; and D. displaying the message names and thevalues corresponding to the message partitions on an operating screen.2. The method of claim 1, wherein in step A, the predetermined formatfurther comprises a major index description table; the major indexdescription table comprises a standard format table and a major indextable; the standard format table determines a plurality of bit lengthvalues corresponding to the bits of the first packet section and thesecond packet section of the at least one packet by a length fieldfilled with the bit length values, and determines a plurality of packetsection names and a plurality of packet section displaying names by apacket section name field and a displaying name field; the major indextable comprises a major index field which is adapted to be filled withat least one of the packet section names of the first packet section asa name of the major index.
 3. The method of claim 2, wherein in step A,the major index table has a start bit field adapted to be filled with astart bit value and an end bit field adapted to be filled with an endbit value, and corresponds to at least one of the packet section namesof the first packet sections; at least one of the packet section namesof the first packet sections corresponds to at least one of the bitlength values; the start bit value and the end bit value form a bitfetching range to determine a start bit fetching position and an end bitfetching position of the corresponding bit length value.
 4. The methodof claim 3, wherein in step C, the fetching bits of the first packetsections within the bit fetching range are fetched, and the major indexvariables of the data format table are compared to find one of the majorindex variables that matches the fetching bits, and the bits of thesecond packet section are analyzed according to a characteristic of thedata fields describing the characteristic of the corresponding majorindex variable, and the corresponding value is analyzed based on one ofthe section length values and one of the data-type names correspondingto the corresponding major index variable, thereby to give thecorresponding value the corresponding data-type name as thecorresponding message name of the corresponding message partition. 5.The method of claim 3, wherein in step A, the predetermined formatfurther comprises a string table; the string table comprises the namefields, a value field, and a displaying name field, which are adapted tobe respectively filled with the data-type names for describing thecharacteristic of each of the data-type names, each of the valuescorresponding to one of the data-type names, and a data displaying namecorresponding to each of the data-type names; in step C, the followingfurther steps are done, fetching the fetching bits of the first packetsections within the bit fetching range, and comparing the major indexvariables of the data format table to find one of the major indexvariables that matches the fetching bits, and analyzing the bits of thesecond packet section according to a characteristic of the data fieldsdescribing the characteristic of the corresponding major index variable,and analyzing the corresponding value based on one of the section lengthvalues and one of the data-type names corresponding to the correspondingmajor index variable and based on one of the data displaying namescorresponding to the corresponding data-type name and the correspondingvalue in the string table, thereby to give the corresponding value thecorresponding data displaying name as the corresponding message name ofthe corresponding message partition.
 6. The method of claim 3, whereinin step A, each of the data fields further comprises a significant bitfield (MSB/LSB) and a minor index field, which are adapted to berespectively filled with the significant bit variable and a minor indexvariable for describing the characteristic of each of the data fields;in step C, the following further steps are done, fetching the fetchingbits of the first packet sections within the bit fetching range, andcomparing the major index variables of the data format table to find oneof the major index variables that matches the fetching bits, andanalyzing the bits of the second packet section according to acharacteristic of the data fields describing the characteristic of thecorresponding major index variable, and analyzing the correspondingvalue based on the corresponding section length value, the correspondingdata-type name, the corresponding significant bit variable, and thecorresponding minor index variable corresponding to the correspondingmajor index variable, thereby to give the corresponding value thecorresponding data-type name as the corresponding message name of thecorresponding message partition.
 7. The method of claim 3, wherein instep A, each of the data fields further comprises a significant bitfield (MSB/LSB) and a minor index field, which are adapted to berespectively filled with the significant bit variable and a minor indexvariable for describing the characteristic of each of the data fields;the predetermined format further comprises a string table, wherein thestring table comprises the name fields, a value field, and a displayingname field, which are adapted to be respectively filled with thedata-type names for describing the characteristic of each of thedata-type names, each of the values corresponding to one of thedata-type names, and a data displaying name corresponding to each of thedata-type names; in step C, the following further steps are done,fetching the fetching bits of the first packet sections within the bitfetching range, and comparing the major index variables of the dataformat table to find one of the major index variables that matches thefetching bits, and analyzing the bits of the second packet sectionaccording to a characteristic of the data fields describing thecharacteristic of the corresponding major index variable, and analyzingthe corresponding value based on the corresponding section length value,the corresponding significant bit variable, the corresponding minorindex variable, and the corresponding data-type name corresponding tothe corresponding major index variable, and based on one of the datadisplaying names corresponding to the data-type name and thecorresponding value in the string table, thereby to give thecorresponding value the corresponding data displaying name as thecorresponding message name of the corresponding message partition. 8.The method of claim 1, wherein in step A, the data format table furthercomprises a message name field filled with a message name string; themessage name string corresponds to each of the major index variables andis used as a name of the corresponding major index variable.